#include <iostream>
 
class A
{
public:
    static A* GetA(){
        if (Count > 0){
            
            Count--;
            return new A();
        }
        else
        {
            return NULL;
        }
    }
private:
    A(){};
    static int Count;   
};
 
int A::Count = 1;  
int main()
{
    A* test;  
    test = A::GetA();
    return 0;
}
